home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 19 / madtrb11.zip / INTR.INC < prev    next >
Text File  |  1985-08-05  |  2KB  |  81 lines

  1. {INTR.INC}
  2.  
  3. {
  4. These routines use some of the MS-DOS/PC-DOS interrupts
  5. to increase the flexibility of Turbo Pascal.  Included
  6. are routines to read the system time and date, and to
  7. control the cursor size.
  8.  
  9. Source: "INTRoducing The INTR Procedure", TUG Lines Volume I Issue 5
  10. Author: Marshall Brain/Brain Software Systems
  11. Application: IBM PC (and true compatibles)
  12. }
  13.  
  14. procedure gettime(var hours,minutes,seconds:byte);
  15. var
  16.    result : record
  17.      ax,bx,cx,dx,bp,si,di,ds,es,flags : integer;
  18.    end;
  19. begin
  20.   result.ax:=$2c00;
  21.   intr($21,result);
  22.   hours:=hi(result.cx);
  23.   minutes:=lo(result.cx);
  24.   seconds:=hi(result.dx);
  25. end;
  26.  
  27. procedure getdate(var month,day:byte; var year:integer);
  28. var
  29.    result : record
  30.      ax,bx,cx,dx,bp,si,di,ds,es,flags : integer;
  31.    end;
  32. begin
  33.   result.ax:=$2a00;
  34.   intr($21,result);
  35.   month:=hi(result.dx);
  36.   day:=lo(result.dx);
  37.   year:=result.cx;
  38. end;
  39.  
  40. procedure cursoff;
  41. var
  42.    result : record
  43.      ax,bx,cx,dx,bp,si,di,ds,es,flags : integer;
  44.    end;
  45. begin
  46.   if mem[$0000:$0449] = 7 then
  47.     result.cx:=$4000
  48.   else
  49.     result.cx:=$2000;
  50.   result.ax:=$0100;
  51.   intr($10,result);
  52. end;
  53.  
  54. procedure cursnorm;
  55. var
  56.    result : record
  57.      ax,bx,cx,dx,bp,si,di,ds,es,flags : integer;
  58.    end;
  59. begin
  60.   if mem[$0000:$0449] = 7 then
  61.     result.cx:=$0b0c
  62.   else
  63.     result.cx:=$0707;
  64.   result.ax:=$0100;
  65.   intr($10,result);
  66. end;
  67.  
  68. procedure curson;
  69. var
  70.    result : record
  71.      ax,bx,cx,dx,bp,si,di,ds,es,flags : integer;
  72.    end;
  73. begin
  74.   if mem[$0000:$0449] = 7 then
  75.     result.cx:=$000d
  76.   else
  77.     result.cx:=$0007;
  78.   result.ax:=$0100;
  79.   intr($10,result);
  80. end;
  81.